package com.df.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//坐标点
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Point {
    float x;
    float y;

    public float distance(Point other){
        double r = Math.pow(other.x - x, 2) + Math.pow(other.y - y, 2);
        double sqrt = Math.sqrt(r);
        return (float) sqrt;
    }
}
